package com.hello.system.service.impl;

import java.util.List;
import com.hello.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.hello.system.mapper.DataStatisticsSummaryMapper;
import com.hello.system.domain.DataStatisticsSummary;
import com.hello.system.service.IDataStatisticsSummaryService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;

/**
 * 数据统计汇总Service业务层处理
 * 
 * @author hello
 * @date 2025-09-09
 */
@Slf4j
@Service
@RequiredArgsConstructor
public class DataStatisticsSummaryServiceImpl extends ServiceImpl<DataStatisticsSummaryMapper, DataStatisticsSummary> implements IDataStatisticsSummaryService 
{
    private final DataStatisticsSummaryMapper dataStatisticsSummaryMapper;

    /**
     * 查询数据统计汇总
     * 
     * @param summaryId 数据统计汇总主键
     * @return 数据统计汇总
     */
    @Override
    public DataStatisticsSummary selectDataStatisticsSummaryBySummaryId(Long summaryId)
    {
        return dataStatisticsSummaryMapper.selectDataStatisticsSummaryBySummaryId(summaryId);
    }

    /**
     * 查询数据统计汇总列表
     * 
     * @param dataStatisticsSummary 数据统计汇总
     * @return 数据统计汇总
     */
    @Override
    public List<DataStatisticsSummary> selectDataStatisticsSummaryList(DataStatisticsSummary dataStatisticsSummary)
    {
        return dataStatisticsSummaryMapper.selectDataStatisticsSummaryList(dataStatisticsSummary);
    }

    /**
     * 新增数据统计汇总
     * 
     * @param dataStatisticsSummary 数据统计汇总
     * @return 结果
     */
    @Override
    public int insertDataStatisticsSummary(DataStatisticsSummary dataStatisticsSummary)
    {
        dataStatisticsSummary.setCreateTime(DateUtils.getNowDate());
        return dataStatisticsSummaryMapper.insertDataStatisticsSummary(dataStatisticsSummary);
    }

    /**
     * 修改数据统计汇总
     * 
     * @param dataStatisticsSummary 数据统计汇总
     * @return 结果
     */
    @Override
    public int updateDataStatisticsSummary(DataStatisticsSummary dataStatisticsSummary)
    {
        dataStatisticsSummary.setUpdateTime(DateUtils.getNowDate());
        return dataStatisticsSummaryMapper.updateDataStatisticsSummary(dataStatisticsSummary);
    }


    /**
     * 批量删除数据统计汇总
     * 
     * @param summaryIds 需要删除的数据统计汇总主键
     * @return 结果
     */
    @Override
    public int deleteDataStatisticsSummaryBySummaryIds(Long[] summaryIds)
    {
        return dataStatisticsSummaryMapper.deleteDataStatisticsSummaryBySummaryIds(summaryIds);
    }

    /**
     * 删除数据统计汇总信息
     * 
     * @param summaryId 数据统计汇总主键
     * @return 结果
     */
    @Override
    public int deleteDataStatisticsSummaryBySummaryId(Long summaryId)
    {
        return dataStatisticsSummaryMapper.deleteDataStatisticsSummaryBySummaryId(summaryId);
    }
}
